import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const HomePage = () =>
  import(/* webpackChunkName: "bcHomePage/HomePage" */ '../page/HomePage.vue')
const MyReservation = () =>
  import(
    /* webpackChunkName: "bcHomePage/MyReservation" */ '../page/MyReservation.vue'
  )

const router = new Router({
  routes: [
    {
      path: '/',
      component: HomePage,
      name: 'homepage'
    },
    {
      path: '/myreservation',
      component: MyReservation,
      name: 'myreservation'
    }
  ]
})
// router.beforeEach((to, from, next) => {
//   console.log('~~~from.path', from.path)
//   console.log('~~~to.path', to.path)
//   let path = '/'
//   if (path === to.path) {
//     router.replace({ path: 'homepage' })
//   }
//   next()
// })
export default router
